import 'package:get/get.dart';
import 'package:oramemo/pages/record/record_router.dart';
import 'create_list_state.dart';

class CreateListLogic extends GetxController {
  final CreateListState state = CreateListState();

  // 切换标签
  void switchTab(TabType tab) {
    state.currentTab.value = tab;
    if (tab == TabType.recording) {
      // 导航到录音页面
      Get.toNamed('/recording');
    }
  }
  
  // 添加新回忆录
  void addNewMemoir() {
    Get.toNamed('/createsetting');
  }
  
  // 添加新故事
  void addNewStory() {
    Get.toNamed('/createsetting');
  }
  
  // 打开回忆录详情
  void openMemoirDetail(Memoir memoir) {
    Get.toNamed('/memoir_detail', arguments: memoir);
  }
  
  // 打开故事详情
  void openStoryDetail(Story story) {
    Get.toNamed(RecordRouter.storyDetailPage, arguments: story);
  }
} 